package com.xyht.sca_s.student_manage_system.modules.teachersDemeanor.controller;


import com.xyht.sca_s.student_manage_system.common.commonReturn.ResponseResult;
import com.xyht.sca_s.student_manage_system.common.desEncodeAndDecode.annotation.SecretBody;
import com.xyht.sca_s.student_manage_system.modules.teachersDemeanor.entity.req.SmsTeachersDemeanorAddReq;
import com.xyht.sca_s.student_manage_system.modules.teachersDemeanor.entity.req.SmsTeachersDemeanorDeletedReq;
import com.xyht.sca_s.student_manage_system.modules.teachersDemeanor.service.SmsTeachersDemeanorService;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 * 教师风采配置表 前端控制器
 * </p>
 *
 * @author XYHT
 * @since 2023-09-03
 */
@RestController
@RequestMapping("/teachersDemeanor")
@SecretBody
public class SmsTeachersDemeanorController {

    @Resource
    private SmsTeachersDemeanorService smsTeachersDemeanorService;

    @ApiModelProperty("添加教师风采人物")
    @PostMapping("/add")
    public ResponseResult addTeachersDemeanor(@RequestBody SmsTeachersDemeanorAddReq addReq){
        return smsTeachersDemeanorService.addTeachersDemeanor(addReq);
    }


    @ApiModelProperty("查看教师风采人物")
    @GetMapping("/get")
    public ResponseResult getTeachersDemeanor(@RequestParam(value = "tchId",required = false) String tchId){
        return smsTeachersDemeanorService.getTeachersDemeanor(tchId);
    }


    @ApiModelProperty("删除教师风采人物")
    @PostMapping("/deleted")
    public ResponseResult deletedTeachersDemeanor(@RequestBody SmsTeachersDemeanorDeletedReq deletedReq){
        return smsTeachersDemeanorService.deletedTeachersDemeanor(deletedReq);
    }


    @ApiModelProperty("查看教师风采人物列表")
    @GetMapping("/list")
    public ResponseResult getTeachersDemeanorList(@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
                                                  @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                  @RequestParam(value = "teacherName",required = false) String teacherName){
        return smsTeachersDemeanorService.getTeachersDemeanorList(pageSize,pageNum,teacherName);
    }

}

